pp108 : Adding a Workflow Library to User Interface Applications

Adding a Workflow Library to User Interface Applications

This topic describes the procedure to add a workflow library to a user interface application.

Before you begin this task:
You must have the process developer role in the Process Platform Business Process Engine application package to add a workflow library to a User Interface (UI) application.

Application services can be of different types, such as XForms, or other Web Page URL-based UI applications such as HTML, JSP, and so on. An application service can be 'workflow-enabled' by adding a workflow library to it. For an XForm, the wrappers for the corresponding application handle the workflow. For a UI application, the workflow library has to be added by an application developer.

  1. Open the <UI page> to which you are adding the workflow library in a text editor. For example, consider an HTML application such as clickappservice.htm.
  2. Provide the HTML element <div> under the body tag.
  3. Provide <div id='workflowEnabling' style='display:none'></div> within this tag. The <div> tag will not be displayed as the workflow library does not have a user interface.
  4. Add application.addLibrary('/cordys/cas/vcm/library/workflow.htm', workflowEnabling); to the <div> tag to add the workflow library during startup or initialization of the page. The workflow library is added to the <div> tag.
  5. Register the function (workflowEnabling.setPostInitializeFunction(postInitialize);. This function is called when initialization succeeds. The function is registered.
  6. Add workflowEnabling.initializeWorkflow(); to call the initializeWorkflow() function to initialize workflow synchronization (for example:retrieving task details). The postInitialize function must take the data from the APIs found in the /cordys/cas/vcm/library and render the data in the UI applications. For more information on the library functions, refer to Workflow library.
  7. Add application.removeLibrary('/cordys/cas/vcm/library/workflow.htm', workflowEnabling); to remove the workflow library from the element to which it was added when the page is closed or unloaded. The workflow library is removed.
    The application service is 'workflow enabled'.